#include<iostream>
#include"namesp.h"
namespace pers
{
    using std::cout;
    using std::cin;
    void getPerson(Person &rp)
    {
        cout<<"输入姓";
        cin>>rp.fname;
        cout<<"输入名";
        cin>>rp.lname;
    }
    void showPerson(const Person &rp)
    {
        cout<<rp.fname<<","<<rp.lname;
    }
}
namespace debts
{
    void getDebt(Debt &rd)
    {
        getPerson(rd.name);
        std::cout<<"输入借款";
        std::cin>>rd.amount;
    }
    void showDebt(const Debt &rd)
    {
        showPerson(rd.name);
        std::cout<<":$"<<rd.amount<<std::endl;
    }
    double sumDebts(const Debt ar[],int n)
    {
        double total=0;
        for (int i = 0; i < n; i++)
        {
            total+=ar[i].amount;
        }
        return total;
    }
}